package org.brian.webscrape;

import java.util.Date;

public class CLPost {
	
//create table post (id integer primary key identity,link varchar,post_date date,bedrooms varchar,price double, location_descvarchar)
//insert into post(link,post_date,bedrooms,price) values ('test', now(), 1, 1.0)

	private Date dateStr;
	private String url;
	private Integer price;
	private Integer bedrooms;
	private String locationDesc;
	private Integer footage; //ft^2
	
	public Date getDate() {
		return dateStr;
	}

	public String getUrl() {
		return url;
	}

	public Integer getPrice() {
		return price;
	}

	public Integer getBedrooms() {
		return bedrooms;
	}

	public CLPost(Date dt, String url, Integer price, Integer brs, String locationDesc, Integer footage){
		this.dateStr = dt;
		this.url = url;
		this.price = price;
		this.bedrooms = brs;
		this.locationDesc = locationDesc;
		this.footage = footage;
	}
	
	public Integer getFootage(){
		return footage;
	}
	
	public String toString(){
		StringBuilder sb = new StringBuilder();
		if(null != dateStr){
			sb.append("Date: "+dateStr.toString());
		}
		if(null != url){
			sb.append("  url: " +url);
		}
		if(null != price){
			sb.append(" price: "+price);
		}
		if(null != bedrooms){
			sb.append(" bedrooms: "+bedrooms);
		}
		if(null != footage){
			sb.append(" footage: "+footage);
		}
		return  sb.toString();
	}
	
}
